package com.hellobike.haxing.modules.shop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hellobike.haxing.modules.shop.entity.Shop;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.math.BigDecimal;

/**
 * @Description: 自提点
 * @Author: haxing-boot
 * @Date:   2020-02-03
 * @Version: V1.0
 */
public interface ShopMapper extends BaseMapper<Shop> {
    /**
     * 更新收入
     * @param amount
     * @param shopId
     * @return
     */
    @Update("update t_shop set total_amount=total_amount+#{amount},update_time=now() where id=#{shopId} ")
    int updateIncome(@Param("amount") BigDecimal amount, @Param("shopId") Long shopId);
}
